libxl: Change default for b_info->{cpu, node}map to "not allocated"
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 20 Jun 2014 16:19:29 +0000 (18:19 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 27 Jun 2014 12:38:33 +0000 (13:38 +0100)
commit194e71830d8d09c9a75ed41abe02d3b8bb6ebe42
tree04f6ec770dbb0c055c2b8a2ac1a10c1db08a4897
parent871b43a309d80ac99458c13c2c3da8d15c482d30
libxl: Change default for b_info->{cpu, node}map to "not allocated"

by avoiding allocating them in libxl__domain_build_info_setdefault.
In fact, back in 7e449837 ("libxl: provide _init and _setdefault for
libxl_domain_build_info") and a5d30c23 ("libxl: allow for explicitly
specifying node-affinity"), it was decided that the default for these
fields was for them to be allocated and filled.

That is now causing problem, whenever we have to figure out whether
the caller is using or not one of those fields. In fact, when we see
a full bitmap, is it just the default value, or is the user that
wants it that way?

Since that kind of knowledge has become important, change the default
to be "bitmap not allocated". It then becomes easy to know whether a
libxl caller is using one of the fields, just by checking whether the
bitmap is actually there with a non-zero size.

This is very important for the following patches introducing new ways
of specifying hard and soft affinity. It also allows us to improve
the checks around NUMA automatic placement, during domain creation
(and that bit is done in this very patch).

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_create.c
tools/libxl/libxl_dom.c